package Participants.CapitoGuye;

class Case {

    /*------------------------------------------------------------------*\
    |*							Constructeurs							*|
    \*------------------------------------------------------------------*/
    public Case(int i, int j, int val) {
        this.i = i;
        this.j = j;
        this.val = val;
    }

    public Case(Case caseCopy) {
        this.val = caseCopy.getVal();
        this.i = caseCopy.getI();
        this.j = caseCopy.getJ();
    }

    /*------------------------------------------------------------------*\
    |*							Methodes Public							*|
    \*------------------------------------------------------------------*/

    /*------------------------------*\
    |*				Set				*|
    \*------------------------------*/
    public void set(int val) {
        this.val = val;
    }

    /*------------------------------*\
    |*				Get				*|
    \*------------------------------*/
    public int getVal() {
        return this.val;
    }

    public int getI() {
        return this.i;
    }

    public int getJ() {
        return this.j;
    }

    /*------------------------------*\
    |*			 Object				*|
    \*------------------------------*/
    @Override
    public String toString() {
        return "(i;j) => (" + i + ";" + j + ") =>" + val + "\n";
    }

    public boolean isInAnEdge() {
        if ((i == 0 || i == 7) || (j == 0 || j == 7)) {
            return true;
        } else {
            return false;
        }
    }

    public boolean isInCorner() {
        if ((i == 0 || i == 7) && (j == 0 || j == 7)) {
            return true;
        } else {
            return false;
        }
    }

    /*------------------------------------------------------------------*\
    |*							Attributs Private						*|
    \*------------------------------------------------------------------*/
    private int i;
    private int j;
    private int val;
}
